package C;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class C12My {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();

        System.out.println(getResult(nums));

    }
    public static int getResult(int[] nums) {
        HashMap<Integer,Integer> map = new HashMap<>();
        for (int num:nums) {
            map.put(num, map.getOrDefault(num,0)+1);
        }

        int maxCount = map.values().stream().max((a,b)->a-b).orElse(0);
        ArrayList<Integer> ans = new ArrayList<>();
        for (Integer key:map.keySet()) {
            if (map.get(key) == maxCount) {
                ans.add(key);
            }
        }

        ans.sort((a,b) -> a-b);
        int length = ans.size();
        System.out.println(length);
        return length%2==0 ? ((ans.get(length/2)+ans.get(length/2-1))/2) : ans.get(length/2);
    }
}
